using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace PlatformShoot
{
    public class CameraCtrl : MonoBehaviour
    {
        private Transform mTarget;
        // Start is called before the first frame update
        private void Start()
        {
            mTarget = GameObject.FindGameObjectWithTag("Player").transform;//让镜头获取目标组件，object不加s，有s的为所有目标
        }

        // Update is called once per frame
        private void LateUpdate()
        {
            transform.localPosition = new Vector3(mTarget.position.x,mTarget.position.y,-10);//跟随目标，但摄像机z轴不能改变
        }
    }
}
